package com.redside.model.lookup;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.redside.model.list.OptionsBean;


/**
 * This class represents the lookup class that holds the name/value pairs
 * for business category types.
 * 
 * @author <a href="mailto:pchapman@redsidesoftware.com">Peter Chapman</a>
 */

@Entity
@Table(name="bus_cat_lkp")
public class BusinessCatLkp implements java.io.Serializable {

    private static final long serialVersionUID = -6920072304450143853L;
    
    @Id
    @Column( name="id", unique=true, nullable=false, updatable=false )
    private Long id;
    
    @Column(name="type",nullable=false,length=50)
    private String type;

    public BusinessCatLkp() {
    }

    public BusinessCatLkp(Long id, String type) {
        this.id=id;
        this.type=type;
    }
    
    public BusinessCatLkp(OptionsBean option){
        this.id=Long.valueOf(option.getId());
        this.type=option.getValue();
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the type
     */
    public String getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(String type) {
        this.type = type;
    }


}
